package cn.itsource.ymcc.web.controller;

import cn.itsource.ymcc.result.JsonResult;
import cn.itsource.ymcc.service.ILoginService;
import cn.itsource.ymcc.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/auth")
public class LoginController {
    @Autowired
    private ILoginService loginService;

    @RequestMapping("/accountLogin")
    public JsonResult loginSuccess(@RequestBody @Valid LoginVo loginVo){
        return JsonResult.success().setData(loginService.accountLogin(loginVo));
    }

    //@PreAuthorize("hasAnyAuthority('employee:add','employee:update')")
    @RequestMapping("/course/pagelist")
    public String pagelist(){
        return "课程列表";
    }
}
